Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(readme): test instructions #1022

Draft
wants to merge 9 commits into
base: master
Choose a base branch
from

Conversation

MantisClone
Copy link
Member

@MantisClone MantisClone commented Dec 21, 2022

@MantisClone
Copy link
Member Author

After these fixes, a new error revealed.

  1 failing

  1) contract: ChainlinkConversionPath
       admin tasks
         can updateAggregator and updateAggregatorsList:

      AssertionError: expected '0x3333333333333333333333333333333333333333' to equal '0x0000000000000000000000000000000000000000'
      + expected - actual

      -0x3333333333333333333333333333333333333333
      +0x0000000000000000000000000000000000000000
      
      at /home/mantisclone/projects/requestNetwork/packages/smart-contracts/test/contracts/ChainlinkConversionPath.test.ts:35:33
      at Generator.next (<anonymous>)
      at fulfilled (node_modules/tslib/tslib.js:114:62)
      at runMicrotasks (<anonymous>)
      at processTicksAndRejections (node:internal/process/task_queues:96:5)



info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.
info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.

lerna ERR! yarn run test stderr:
error Command failed with exit code 1.
error Command failed with exit code 1.

lerna ERR! yarn run test exited 1 in '@requestnetwork/smart-contracts'
error Command failed with exit code 1.
info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.

@coveralls
Copy link

coveralls commented Dec 21, 2022

Coverage Status

Coverage: 87.987%. Remained the same when pulling 4339035 on mantisclone/dw-59/yarn-run-test-fails into 0131e6c on master.

@MantisClone
Copy link
Member Author

MantisClone commented Jan 3, 2023

It's difficult to run the full test suite on my local machine. I can't get the tests to recognize my IPFS node running locally. I tried installing docker and running the same docker image that the Circle CI tests use.

Nonetheless, I'm going to try and set this task aside for now because it's not a high priority.

I pulled out the useful parts of this PR into #1036 and #1038

@MantisClone
Copy link
Member Author

I got past the ChainlinkConversionPath contract test today by using dev-services

mantisclone@mantisclone-Inspiron-7620:~/projects/dev-services$ COMPOSE_MODE=full make up
Test output
mantisclone@mantisclone-Inspiron-7620:~/projects/requestNetwork$ export DISABLE_API_TESTS=1
mantisclone@mantisclone-Inspiron-7620:~/projects/requestNetwork$ yarn run test
yarn run v1.22.19
$ lerna run test
lerna notice cli v3.22.1
lerna info versioning independent
lerna info Executing command in 19 packages: "yarn run test"
lerna info run Ran npm script 'test' in '@requestnetwork/multi-format' in 6.9s:
$ jest
-------------------------------------------|---------|----------|---------|---------|-------------------
File                                       | % Stmts | % Branch | % Funcs | % Lines | Uncovered Line #s 
-------------------------------------------|---------|----------|---------|---------|-------------------
All files                                  |   98.02 |    92.86 |     100 |   97.96 |                   
 src                                       |   96.36 |       90 |     100 |   96.15 |                   
  group-multi-format.ts                    |   88.24 |       50 |     100 |   86.67 | 60,80             
  hexadecimal-serializable-multi-format.ts |     100 |      100 |     100 |     100 |                   
  index.ts                                 |     100 |      100 |     100 |     100 |                   
  serializable-multi-format.ts             |     100 |      100 |     100 |     100 |                   
 src/encryption                            |     100 |      100 |     100 |     100 |                   
  aes256-cbc-format.ts                     |     100 |      100 |     100 |     100 |                   
  aes256-gcm-format.ts                     |     100 |      100 |     100 |     100 |                   
  ecies-format.ts                          |     100 |      100 |     100 |     100 |                   
  encryption-format.ts                     |     100 |      100 |     100 |     100 |                   
 src/hash                                  |     100 |      100 |     100 |     100 |                   
  hash-format.ts                           |     100 |      100 |     100 |     100 |                   
  keccak256-format.ts                      |     100 |      100 |     100 |     100 |                   
 src/identity                              |     100 |      100 |     100 |     100 |                   
  ethereum-address-format.ts               |     100 |      100 |     100 |     100 |                   
  identity-format.ts                       |     100 |      100 |     100 |     100 |                   
 src/plain                                 |     100 |      100 |     100 |     100 |                   
  plain-format.ts                          |     100 |      100 |     100 |     100 |                   
  plain-text-format.ts                     |     100 |      100 |     100 |     100 |                   
-------------------------------------------|---------|----------|---------|---------|-------------------
lerna info run Ran npm script 'test' in '@requestnetwork/data-format' in 7.8s:
$ jest
------------------------|---------|----------|---------|---------|-------------------
File                    | % Stmts | % Branch | % Funcs | % Lines | Uncovered Line #s 
------------------------|---------|----------|---------|---------|-------------------
All files               |     100 |    93.75 |     100 |     100 |                   
 src                    |     100 |    93.75 |     100 |     100 |                   
  index.ts              |     100 |    93.75 |     100 |     100 | 27                
 src/format             |     100 |      100 |     100 |     100 |                   
  index.ts              |     100 |      100 |     100 |     100 |                   
 src/format/rnf_invoice |     100 |    93.75 |     100 |     100 |                   
  index.ts              |     100 |      100 |     100 |     100 |                   
  utils.ts              |     100 |    93.75 |     100 |     100 | 15                
------------------------|---------|----------|---------|---------|-------------------
lerna info run Ran npm script 'test' in '@requestnetwork/utils' in 10.1s:
$ jest
-----------------------|---------|----------|---------|---------|------------------------------------------
File                   | % Stmts | % Branch | % Funcs | % Lines | Uncovered Line #s                        
-----------------------|---------|----------|---------|---------|------------------------------------------
All files              |   87.23 |    69.78 |   83.45 |   86.31 |                                          
 src                   |   85.79 |    66.91 |    81.3 |   84.48 |                                          
  amount.ts            |     100 |      100 |     100 |     100 |                                          
  bignumber.ts         |     100 |      100 |     100 |     100 |                                          
  cached-throttle.ts   |   90.91 |    83.33 |     100 |   90.91 | 13                                       
  crypto.ts            |     100 |      100 |     100 |     100 |                                          
  encryption.ts        |     100 |      100 |     100 |     100 |                                          
  estimate-gas-fees.ts |   36.36 |        0 |       0 |   36.36 | 26-40                                    
  identity.ts          |   61.54 |       50 |   66.67 |      50 | 46-52                                    
  index.ts             |     100 |      100 |   78.43 |     100 |                                          
  providers.ts         |   32.08 |        0 |       0 |   32.08 | 22,28,55-101,115,130-134,138-149,155-164 
  retry.ts             |     100 |      100 |     100 |     100 |                                          
  signature.ts         |   93.75 |    85.71 |     100 |   93.33 | 93,95                                    
  simple-logger.ts     |     100 |    93.33 |     100 |     100 | 26                                       
  utils.ts             |   97.78 |    83.33 |   93.75 |   97.62 | 161                                      
 src/crypto            |   92.71 |    79.07 |     100 |   92.71 |                                          
  crypto-wrapper.ts    |   97.22 |       50 |     100 |   97.22 | 139                                      
  ec-utils.ts          |      90 |    80.49 |     100 |      90 | 37,59,82,122,154,189                     
-----------------------|---------|----------|---------|---------|------------------------------------------
lerna info run Ran npm script 'test' in '@requestnetwork/web3-signature' in 8.4s:
$ jest
----------------------------|---------|----------|---------|---------|-------------------
File                        | % Stmts | % Branch | % Funcs | % Lines | Uncovered Line #s 
----------------------------|---------|----------|---------|---------|-------------------
All files                   |   88.46 |       80 |     100 |   88.46 |                   
 web3-signature-provider.ts |   88.46 |       80 |     100 |   88.46 | 24,55,65          
----------------------------|---------|----------|---------|---------|-------------------
lerna info run Ran npm script 'test' in '@requestnetwork/epk-decryption' in 9.0s:
$ jest
---------------------------------------------|---------|----------|---------|---------|-------------------
File                                         | % Stmts | % Branch | % Funcs | % Lines | Uncovered Line #s 
---------------------------------------------|---------|----------|---------|---------|-------------------
All files                                    |     100 |    91.67 |     100 |     100 |                   
 ethereum-private-key-decryption-provider.ts |     100 |    91.67 |     100 |     100 | 25                
---------------------------------------------|---------|----------|---------|---------|-------------------
lerna info run Ran npm script 'test' in '@requestnetwork/epk-signature' in 9.5s:
$ jest
--------------------------------------------|---------|----------|---------|---------|-------------------
File                                        | % Stmts | % Branch | % Funcs | % Lines | Uncovered Line #s 
--------------------------------------------|---------|----------|---------|---------|-------------------
All files                                   |     100 |       90 |     100 |     100 |                   
 ethereum-private-key-signature-provider.ts |     100 |       90 |     100 |     100 | 26                
--------------------------------------------|---------|----------|---------|---------|-------------------
lerna info run Ran npm script 'test' in '@requestnetwork/data-access' in 10.1s:
$ jest
---------------------------|---------|----------|---------|---------|-------------------------
File                       | % Stmts | % Branch | % Funcs | % Lines | Uncovered Line #s       
---------------------------|---------|----------|---------|---------|-------------------------
All files                  |   95.82 |    87.16 |   97.12 |   95.69 |                         
 src                       |   97.95 |    88.51 |   98.63 |   97.88 |                         
  block.ts                 |     100 |      100 |     100 |     100 |                         
  data-access.ts           |   96.32 |       75 |   97.22 |   96.18 | 165-170,340,389,521     
  ignored-location.ts      |     100 |      100 |     100 |     100 |                         
  interval-timer.ts        |     100 |    81.82 |     100 |     100 | 61,68                   
 src/transaction-index     |    91.3 |    85.25 |   93.55 |   91.07 |                         
  index.ts                 |     100 |      100 |     100 |     100 |                         
  location-by-topic.ts     |     100 |      100 |     100 |     100 |                         
  timestamp-by-location.ts |   90.48 |    95.24 |    87.5 |   90.48 | 48,62                   
  transaction-index.ts     |   87.88 |    73.33 |   92.86 |   87.69 | 61,78-83,94,111,144,184 
---------------------------|---------|----------|---------|---------|-------------------------
lerna info run Ran npm script 'test' in '@requestnetwork/transaction-manager' in 10.1s:
$ jest
---------------------------|---------|----------|---------|---------|-------------------
File                       | % Stmts | % Branch | % Funcs | % Lines | Uncovered Line #s 
---------------------------|---------|----------|---------|---------|-------------------
All files                  |   97.51 |    90.11 |   97.67 |   97.48 |                   
 src                       |   98.25 |    91.95 |    97.5 |   98.22 |                   
  channel-parser.ts        |     100 |      100 |     100 |     100 |                   
  clear-transaction.ts     |     100 |      100 |     100 |     100 |                   
  encrypted-transaction.ts |   96.43 |       75 |     100 |   96.43 | 63                
  index.ts                 |     100 |      100 |     100 |     100 |                   
  transaction-manager.ts   |    96.3 |    88.89 |      90 |    96.3 | 92,135            
  transactions-factory.ts  |     100 |      100 |     100 |     100 |                   
  transactions-parser.ts   |   97.87 |    91.11 |     100 |   97.87 | 110               
 test/unit/utils           |   84.62 |       50 |     100 |   84.62 |                   
  test-data.ts             |   84.62 |       50 |     100 |   84.62 | 70,74             
---------------------------|---------|----------|---------|---------|-------------------
lerna info run Ran npm script 'test' in '@requestnetwork/currency' in 25.8s:
$ jest
----------------------------|---------|----------|---------|---------|---------------------------------
File                        | % Stmts | % Branch | % Funcs | % Lines | Uncovered Line #s               
----------------------------|---------|----------|---------|---------|---------------------------------
All files                   |   88.58 |    80.58 |   74.07 |      88 |                                 
 src                        |   85.88 |    80.58 |   69.57 |   84.81 |                                 
  conversion-aggregators.ts |      95 |       25 |     100 |      95 | 84                              
  currency-utils.ts         |   77.78 |    78.95 |      20 |   72.73 | 28,45,55,62,66,70               
  currencyManager.ts        |   90.82 |    85.19 |    87.5 |   91.01 | 122,133-135,144,147,168,179,254 
  errors.ts                 |   18.18 |        0 |       0 |   18.18 | 6-11,19-24                      
  getHash.ts                |     100 |      100 |     100 |     100 |                                 
  index.ts                  |     100 |      100 |      20 |     100 |                                 
  iso4217.ts                |     100 |      100 |     100 |     100 |                                 
  native.ts                 |     100 |      100 |     100 |     100 |                                 
 src/erc20                  |     100 |      100 |     100 |     100 |                                 
  index.ts                  |     100 |      100 |     100 |     100 |                                 
 src/erc20/networks         |     100 |      100 |     100 |     100 |                                 
  avalanche.ts              |     100 |      100 |     100 |     100 |                                 
  bsc.ts                    |     100 |      100 |     100 |     100 |                                 
  bsctest.ts                |     100 |      100 |     100 |     100 |                                 
  celo.ts                   |     100 |      100 |     100 |     100 |                                 
  fantom.ts                 |     100 |      100 |     100 |     100 |                                 
  goerli.ts                 |     100 |      100 |     100 |     100 |                                 
  index.ts                  |     100 |      100 |     100 |     100 |                                 
  mainnet.ts                |     100 |      100 |     100 |     100 |                                 
  matic.ts                  |     100 |      100 |     100 |     100 |                                 
  moonbeam.ts               |     100 |      100 |     100 |     100 |                                 
  optimism.ts               |     100 |      100 |     100 |     100 |                                 
  rinkeby.ts                |     100 |      100 |     100 |     100 |                                 
  xdai.ts                   |     100 |      100 |     100 |     100 |                                 
 src/erc777                 |     100 |      100 |     100 |     100 |                                 
  index.ts                  |     100 |      100 |     100 |     100 |                                 
 src/erc777/networks        |     100 |      100 |     100 |     100 |                                 
  index.ts                  |     100 |      100 |     100 |     100 |                                 
  rinkeby.ts                |     100 |      100 |     100 |     100 |                                 
----------------------------|---------|----------|---------|---------|---------------------------------
lerna info run Ran npm script 'test' in '@requestnetwork/advanced-logic' in 11.9s:
$ jest
-------------------------------------------------------|---------|----------|---------|---------|---------------------
File                                                   | % Stmts | % Branch | % Funcs | % Lines | Uncovered Line #s   
-------------------------------------------------------|---------|----------|---------|---------|---------------------
All files                                              |    97.2 |    90.54 |   99.01 |   97.19 |                     
 src                                                   |     100 |    96.97 |     100 |     100 |                     
  advanced-logic.ts                                    |     100 |    96.97 |     100 |     100 | 54                  
  index.ts                                             |     100 |      100 |     100 |     100 |                     
 src/extensions                                        |     100 |      100 |     100 |     100 |                     
  abstract-extension.ts                                |     100 |      100 |     100 |     100 |                     
  content-data.ts                                      |     100 |      100 |     100 |     100 |                     
 src/extensions/payment-network                        |   95.03 |    90.53 |   98.21 |   95.02 |                     
  address-based.ts                                     |     100 |    96.61 |     100 |     100 | 282-290             
  any-to-erc20-proxy.ts                                |   92.86 |    92.11 |     100 |   92.68 | 49,71,135           
  any-to-eth-proxy.ts                                  |   95.24 |    93.75 |     100 |   95.24 | 39                  
  any-to-native.ts                                     |   95.65 |      100 |      80 |   95.65 | 42                  
  declarative.ts                                       |     100 |    85.71 |     100 |     100 | 201-215             
  fee-reference-based.ts                               |   87.23 |    89.29 |     100 |   87.23 | 43,46,73,76,102,170 
  native-token.ts                                      |      95 |    94.44 |     100 |      95 | 41                  
  reference-based.ts                                   |   71.43 |       50 |     100 |   71.43 | 25,29,52,56         
 src/extensions/payment-network/bitcoin                |     100 |      100 |     100 |     100 |                     
  mainnet-address-based.ts                             |     100 |      100 |     100 |     100 |                     
  testnet-address-based.ts                             |     100 |      100 |     100 |     100 |                     
 src/extensions/payment-network/erc20                  |     100 |      100 |     100 |     100 |                     
  address-based.ts                                     |     100 |      100 |     100 |     100 |                     
  fee-proxy-contract.ts                                |     100 |      100 |     100 |     100 |                     
  proxy-contract.ts                                    |     100 |      100 |     100 |     100 |                     
  transferable-receivable.ts                           |     100 |      100 |     100 |     100 |                     
 src/extensions/payment-network/erc777                 |   84.21 |    85.71 |     100 |   84.21 |                     
  stream.ts                                            |   84.21 |    85.71 |     100 |   84.21 | 34,42,46,85,97,105  
 src/extensions/payment-network/ethereum               |     100 |      100 |     100 |     100 |                     
  fee-proxy-contract.ts                                |     100 |      100 |     100 |     100 |                     
  input-data.ts                                        |     100 |      100 |     100 |     100 |                     
 src/extensions/payment-network/near                   |    89.8 |       85 |     100 |    89.8 |                     
  any-to-near-testnet.ts                               |     100 |      100 |     100 |     100 |                     
  any-to-near.ts                                       |   85.71 |    84.21 |     100 |   85.71 | 43,117,164,170,175  
  near-native.ts                                       |     100 |      100 |     100 |     100 |                     
  near-testnet-native.ts                               |     100 |      100 |     100 |     100 |                     
 test/utils                                            |     100 |      100 |     100 |     100 |                     
  test-data-generator.ts                               |     100 |      100 |     100 |     100 |                     
 test/utils/payment-network                            |     100 |      100 |     100 |     100 |                     
  mocked_native_data.ts                                |     100 |      100 |     100 |     100 |                     
 test/utils/payment-network/any                        |     100 |      100 |     100 |     100 |                     
  generator-data-create.ts                             |     100 |      100 |     100 |     100 |                     
 test/utils/payment-network/bitcoin                    |     100 |      100 |     100 |     100 |                     
  generator-data-add-payment-address.ts                |     100 |      100 |     100 |     100 |                     
  generator-data-create.ts                             |     100 |      100 |     100 |     100 |                     
  testnet-generator-data-add-payment-address.ts        |     100 |      100 |     100 |     100 |                     
  testnet-generator-data-create.ts                     |     100 |      100 |     100 |     100 |                     
 test/utils/payment-network/erc20                      |     100 |      100 |     100 |     100 |                     
  address-based-add-payment-address-data-generator.ts  |     100 |      100 |     100 |     100 |                     
  address-based-create-data-generator.ts               |     100 |      100 |     100 |     100 |                     
  any-to-erc20-proxy-add-data-generator.ts             |     100 |      100 |     100 |     100 |                     
  any-to-erc20-proxy-create-data-generator.ts          |     100 |      100 |     100 |     100 |                     
  fee-proxy-contract-add-data-generator.ts             |     100 |      100 |     100 |     100 |                     
  fee-proxy-contract-create-data-generator.ts          |     100 |      100 |     100 |     100 |                     
  proxy-contract-add-payment-address-data-generator.ts |     100 |      100 |     100 |     100 |                     
  proxy-contract-create-data-generator.ts              |     100 |      100 |     100 |     100 |                     
 test/utils/payment-network/erc777                     |     100 |      100 |     100 |     100 |                     
  stream-add-data-generator.ts                         |     100 |      100 |     100 |     100 |                     
  stream-create-data-generator.ts                      |     100 |      100 |     100 |     100 |                     
 test/utils/payment-network/ethereum                   |     100 |      100 |     100 |     100 |                     
  add-payment-address-data-generator.ts                |     100 |      100 |     100 |     100 |                     
  any-to-eth-proxy-add-data-generator.ts               |     100 |      100 |     100 |     100 |                     
  any-to-eth-proxy-create-data-generator.ts            |     100 |      100 |     100 |     100 |                     
  create-data-generator.ts                             |     100 |      100 |     100 |     100 |                     
  fee-proxy-contract-add-data-generator.ts             |     100 |      100 |     100 |     100 |                     
  fee-proxy-contract-create-data-generator.ts          |     100 |      100 |     100 |     100 |                     
-------------------------------------------------------|---------|----------|---------|---------|---------------------
lerna info run Ran npm script 'test' in '@requestnetwork/request-logic' in 18.0s:
$ jest
----------------------------|---------|----------|---------|---------|----------------------------------------------------------------
File                        | % Stmts | % Branch | % Funcs | % Lines | Uncovered Line #s                                              
----------------------------|---------|----------|---------|---------|----------------------------------------------------------------
All files                   |   95.94 |    94.19 |   84.88 |   95.93 |                                                                
 src                        |   94.52 |    93.66 |      80 |    94.5 |                                                                
  action.ts                 |     100 |      100 |     100 |     100 |                                                                
  config.ts                 |     100 |      100 |     100 |     100 |                                                                
  index.ts                  |     100 |      100 |     100 |     100 |                                                                
  request-logic.ts          |   91.53 |    86.76 |   72.92 |   91.53 | 70,128,207-212,257-262,307-312,357-362,408-413,645-649,707,863 
  request.ts                |     100 |      100 |     100 |     100 |                                                                
  requestLogicCore.ts       |     100 |      100 |     100 |     100 |                                                                
  role.ts                   |     100 |      100 |     100 |     100 |                                                                
  version.ts                |     100 |      100 |     100 |     100 |                                                                
 src/actions                |    97.5 |    94.83 |     100 |    97.5 |                                                                
  accept.ts                 |     100 |      100 |     100 |     100 |                                                                
  addExtensionsData.ts      |     100 |    91.67 |     100 |     100 | 97                                                             
  cancel.ts                 |     100 |      100 |     100 |     100 |                                                                
  create.ts                 |   91.53 |       90 |     100 |   91.53 | 177,189-204                                                    
  increaseExpectedAmount.ts |     100 |      100 |     100 |     100 |                                                                
  reduceExpectedAmount.ts   |     100 |      100 |     100 |     100 |                                                                
 test/unit/utils            |     100 |      100 |     100 |     100 |                                                                
  test-data-generator.ts    |     100 |      100 |     100 |     100 |                                                                
----------------------------|---------|----------|---------|---------|----------------------------------------------------------------
lerna ERR! yarn run test exited 6 in '@requestnetwork/smart-contracts'
lerna ERR! yarn run test stdout:
$ yarn hardhat test --network private
$ /home/mantisclone/projects/requestNetwork/node_modules/.bin/hardhat test --network private
No need to generate any newer typings.


  contract: BatchConversionPayments
    1) "before all" hook in "contract: BatchConversionPayments"

  contract: batchNoConversionPayments: ERC20
    Batch working well: right args, and approvals
      ✓ Should pay 3 ERC20 payments with paymentRef and pay batch fee (673ms)
      ✓ Should pay 3 ERC20 payments Multi tokens with paymentRef and pay batch fee (2088ms)
      ✓ Should pay 3 ERC20 payments Multi tokens, with one payment of 0 token (1854ms)
      ✓ Should pay 4 ERC20 payments on 2 tokens (1678ms)
      ✓ Should pay 10 ERC20 payments (965ms)
      ✓ Should pay 10 ERC20 payments on multiple tokens (1050ms)
    Batch revert, issues with: args, or funds, or approval
      ✓ Should revert batch if not enough funds to pay the request (128ms)
      ✓ Should revert batch if not enough funds to pay the batch fee (122ms)
      ✓ Should revert batch without approval (162ms)
      ✓ Should revert batch multi tokens if not enough funds (120ms)
      ✓ Should revert batch multi tokens if not enough funds to pay the batch fee (123ms)
      ✓ Should revert batch multi tokens without approval (115ms)

  contract: batchNoConversionPayments: Ethereum
    Batch Eth normal flow
      ✓ Should pay 2 payments and contract do not keep funds of ethers (159ms)
      ✓ Should pay 2 payments with the exact amount (151ms)
      ✓ Should pay 10 Ethereum payments (277ms)
    Batch revert, issues with: args, or funds
      ✓ Should revert batch if not enough funds (85ms)
      ✓ Should revert batch if not enough funds for the batch fee (61ms)
    Function allowed only to the owner
      ✓ Should allow the owner to update batchFee (67ms)
      ✓ Should applied the new batchFee (106ms)
      ✓ Should revert if it is not the owner that try to update batchFee

  contract: Bytes Utils
    ✓ extractBytes32 works correctly (129ms)

  contract: ChainlinkConversionPath
    admin tasks
      ✓ can updateAggregator and updateAggregatorsList (130ms)
    getRate
      only fiat rates
        ✓ can get rate from EUR to USD
        ✓ can get rate from USD to EUR
        ✓ can get rate from USD to EUR to USD
        ✓ can get rate from ETH to USD to EUR
    Ethereum rates
      ✓ can get rate from USD to ETH
      ✓ can get rate from ETH to USD
      ✓ can get rate from EUR to USD to ETH
      ✓ can get rate from USD to ERC20
      ✓ can get rate from ETH to USD to ERC20
    USDT rates
      ✓ can get rate from USD to ETH to USDT (58ms)
      ✓ can get rate from USDT to ETH to USD
    getConversion
      only fiat conversion
        ✓ can convert EUR to USD
        ✓ can convert USD to EUR
        ✓ can convert USD to EUR to USD
      Ethereum conversion
        ✓ can convert USD to ETH
        ✓ can convert ETH to USD
        ✓ can convert EUR to USD to ETH
        ✓ can convert ETH to USD to EUR
      USDT conversion
        ✓ can convert USD to ETH to USDT
        ✓ can convert USDT to ETH to USD

  contract: Erc20ConversionProxy
    transferFromWithReferenceAndFee
      transferFromWithReferenceAndFee with DAI
        ✓ allows to transfer DAI tokens for USD payment (360ms)
        ✓ allows to transfer DAI tokens for EUR payment (377ms)
      transferFromWithReferenceAndFee with errors
        ✓ cannot transfer with invalid path (66ms)
        ✓ cannot transfer if max to spend too low (74ms)
        ✓ cannot transfer if rate is too old (73ms)

  Contract: ERC20EscrowToPay
    Normal flow:
      ✓ Should transfer amount to escrow and fees to buidler (332ms)
      ✓ Should transfer amount to payee from escrow (409ms)
    Emergency claim flow:
      ✓ Should initiate emergencyClaim w/ 24 week lockperiod and emit event. (290ms)
      ✓ Should revert if claimed before claimDate. (272ms)
      ✓ Should be able to withdraw funds after emergency lockperiod ends (450ms)
    Cancel emergency flow:
      ✓ Should cancel emergencyClaim, reset state and emit event. (353ms)
      ✓ Should revert if emergencyState is canceled. (358ms)
    Freeze request flow:
      ✓ Should set to frozen w/ 52 week lockperiod, cancel emergency claim and emit event. (436ms)
      ✓ Should revert if executed before unlockDate. (255ms)
      ✓ Should revert if try to execute EmergencyClaim while request is frozen (295ms)
    Admin should be able to change emergency and freeze periods
      ✓ Minimum emergency period is 30 days
      ✓ Minimum frozen period is 30 days
      ✓ Should be able to adjust emergency period (109ms)
      ✓ Should be able to adjust freeze period (71ms)
      ✓ Contract creator who is not the owner, should not be able to change periods

  contract: ERC20FeeProxy
    ✓ stores reference and paid fee (157ms)
    ✓ transfers tokens for payment and fees (234ms)
    ✓ should revert if no allowance (97ms)
    ✓ should revert if error (108ms)
    ✓ should revert if no fund (63ms)
    ✓ no fee transfer if amount is 0 (139ms)
    ✓ transfers tokens for payment and fees on BadERC20 (312ms)
    ✓ transfers tokens for payment and fees on a variety of ERC20 contract formats (402ms)

  contract: ERC20Proxy
    ✓ allows to store a reference (80ms)
    ✓ allows to transfer tokens (105ms)
    ✓ should revert if no fund (71ms)

  contract: ERC20SwapToConversion
    ✓ converts, swaps and pays the request (461ms)
    ✓ does not pay anyone if I swap 0 (389ms)
    ✓ cannot swap with a too low maximum spent (79ms)
    ✓ cannot swap with a past deadline (70ms)
    ✓ cannot swap more tokens than liquidity (80ms)
    ✓ cannot swap more tokens than allowance (103ms)
    ✓ Should not swap with a bad proxy address (98ms)

  contract: SwapToPay
    2) "before each" hook for "swaps, pays the request and the fees"

  contract: ERC20TransferableReceivable
    mint
      ✓ revert with empty paymentReference
      ✓ revert with zero amount
      ✓ revert with empty asset address
      ✓ revert with duplicated receivableId (308ms)
      ✓ success (155ms)
      ✓ mints with tokenURI set (126ms)
      ✓ list receivables (1026ms)
    payOwner
      ✓ revert with zero amount
      ✓ reverts when proxy payment ERC20FeeProxy contract fails (107ms)
      ✓ success for original owner (105ms)
      ✓ allow multiple mints per receivable (64ms)
      ✓ payment greater than amount (128ms)
      ✓ payment less than amount (93ms)
      ✓ payment with two different payees (284ms)
      ✓ success for new owner (162ms)

  contract: EthConversionProxy
    transferWithReferenceAndFee
      transferWithReferenceAndFee with ETH
        ✓ allows to transfer ETH for USD payment (172ms)
        ✓ allows to transfer ETH for EUR payment and extra msg.value (203ms)
        ✓ allows to transfer ETH for EUR payment and extra msg.value to a gnosis safe (215ms)
      transferWithReferenceAndFee with errors
        ✓ cannot transfer if msg.value too low for amount (42ms)
        ✓ cannot transfer if msg.value too low for fee (56ms)
        ✓ cannot transfer if rate is too old (60ms)
        ✓ cannot transfer with another native token hash (221ms)

  contract: EthereumFeeProxy
    ✓ allows to pays with a reference (142ms)
    ✓ allows to pays exact eth with a reference with extra msg.value (140ms)
    ✓ cannot transfer if msg.value is too low
    ✓ allows to pay with a reference to a gnosis safe (129ms)
    ✓ allows to pays exact eth with a reference with extra msg.value to a gnosisSafe (148ms)

  contract: EthereumProxy
    ✓ allows to store a reference (40ms)
    ✓ allows to transfer ethers (79ms)
    ✓ allow to transfer ethers to a gnosis safe (107ms)

  contract: RequestHashStorage
    ✓ allows the whitelisted admin to be changed (48ms)
    ✓ does not let non-admin change the admin whitelist
    ✓ allows the whitelist to be changed (99ms)
    ✓ does not let non-admin change the whitelist (46ms)
    ✓ allows whitelisted address to submit hash (64ms)
    ✓ does not let non-whitelisted submit hashes

  contract: RequestOpenHashSubmitter
    addWhitelisted
      ✓ Allows the whitelist to be changed (174ms)
      ✓ Non admin should not be able to change the whitelist (74ms)
    submitHash
      ✓ Allows submitHash without fee (98ms)
      ✓ Allows submitHash with fees (154ms)
      ✓ should not be able to submitHash with the wrong fees (97ms)

  contract: StorageFeeCollector
    addWhitelistAdmin
      ✓ Allows the admin whitelist to be changed (60ms)
      ✓ Non admin should not be able to change the admin whitelist
    setRequestBurnerContract
      ✓ Allows burnerContract to be changed (70ms)
      ✓ Non admin should not be able to change burnerContract
    setFeeParameters
      ✓ Allows parameters to be changed (141ms)
      ✓ Non admin should not be able to change parameters
    getFeesAmount
      ✓ getFeesAmount gives correct values (93ms)
      ✓ getFeesAmount gives correct values under the minimum (69ms)
      ✓ getFeesAmount gives correct values with default value
      ✓ getFeesAmount gives correct values with denominator equal 0 (65ms)
      ✓ getFeesAmount must revert if overflow (67ms)

  payment without application of the batch fee limit USD: skipFeeUSDLimit
    3) make 1 ERC20 payment with no conversion, BATCH_ERC20_PAYMENTS
    4) make 1 ERC20 payment with no conversion
    5) make 3 ERC20 payments with different tokens and conversion lengths
    ✓ make 1 ETH payment without conversion (153ms)
    ✓ make 1 ETH payment with 1-step conversion (740ms)
    6) make n heterogeneous (ERC20 and ETH) payments with and without conversion


  134 passing (49s)
  6 failing

  1) contract: BatchConversionPayments
       "before all" hook in "contract: BatchConversionPayments":
     ProviderError: VM Exception while processing transaction: revert
      at HttpProvider.request (/home/mantisclone/projects/requestNetwork/node_modules/hardhat/src/internal/core/providers/http.ts:49:19)
      at GanacheGasMultiplierProvider._getMultipliedGasEstimation (/home/mantisclone/projects/requestNetwork/node_modules/hardhat/src/internal/core/providers/gas-providers.ts:64:59)
      at GanacheGasMultiplierProvider.request (/home/mantisclone/projects/requestNetwork/node_modules/hardhat/src/internal/core/providers/gas-providers.ts:178:19)
      at processTicksAndRejections (node:internal/process/task_queues:96:5)

  2) contract: SwapToPay
       "before each" hook for "swaps, pays the request and the fees":
     ProviderError: VM Exception while processing transaction: revert
      at HttpProvider.request (/home/mantisclone/projects/requestNetwork/node_modules/hardhat/src/internal/core/providers/http.ts:49:19)
      at GanacheGasMultiplierProvider._getMultipliedGasEstimation (/home/mantisclone/projects/requestNetwork/node_modules/hardhat/src/internal/core/providers/gas-providers.ts:64:59)
      at GanacheGasMultiplierProvider.request (/home/mantisclone/projects/requestNetwork/node_modules/hardhat/src/internal/core/providers/gas-providers.ts:178:19)
      at runMicrotasks (<anonymous>)
      at processTicksAndRejections (node:internal/process/task_queues:96:5)

  3) payment without application of the batch fee limit USD: skipFeeUSDLimit
       make 1 ERC20 payment with no conversion, BATCH_ERC20_PAYMENTS:
     ProviderError: VM Exception while processing transaction: revert
      at HttpProvider.request (/home/mantisclone/projects/requestNetwork/node_modules/hardhat/src/internal/core/providers/http.ts:49:19)
      at GanacheGasMultiplierProvider.request (/home/mantisclone/projects/requestNetwork/node_modules/hardhat/src/internal/core/providers/gas-providers.ts:181:34)
      at runMicrotasks (<anonymous>)
      at processTicksAndRejections (node:internal/process/task_queues:96:5)

  4) payment without application of the batch fee limit USD: skipFeeUSDLimit
       make 1 ERC20 payment with no conversion:
     ProviderError: VM Exception while processing transaction: revert
      at HttpProvider.request (/home/mantisclone/projects/requestNetwork/node_modules/hardhat/src/internal/core/providers/http.ts:49:19)
      at GanacheGasMultiplierProvider.request (/home/mantisclone/projects/requestNetwork/node_modules/hardhat/src/internal/core/providers/gas-providers.ts:181:34)
      at runMicrotasks (<anonymous>)
      at processTicksAndRejections (node:internal/process/task_queues:96:5)

  5) payment without application of the batch fee limit USD: skipFeeUSDLimit
       make 3 ERC20 payments with different tokens and conversion lengths:
     ProviderError: VM Exception while processing transaction: revert
      at HttpProvider.request (/home/mantisclone/projects/requestNetwork/node_modules/hardhat/src/internal/core/providers/http.ts:49:19)
      at GanacheGasMultiplierProvider.request (/home/mantisclone/projects/requestNetwork/node_modules/hardhat/src/internal/core/providers/gas-providers.ts:181:34)
      at runMicrotasks (<anonymous>)
      at processTicksAndRejections (node:internal/process/task_queues:96:5)

  6) payment without application of the batch fee limit USD: skipFeeUSDLimit
       make n heterogeneous (ERC20 and ETH) payments with and without conversion:
     ProviderError: VM Exception while processing transaction: revert
      at HttpProvider.request (/home/mantisclone/projects/requestNetwork/node_modules/hardhat/src/internal/core/providers/http.ts:49:19)
      at GanacheGasMultiplierProvider.request (/home/mantisclone/projects/requestNetwork/node_modules/hardhat/src/internal/core/providers/gas-providers.ts:181:34)
      at runMicrotasks (<anonymous>)
      at processTicksAndRejections (node:internal/process/task_queues:96:5)



info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.
info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.

lerna ERR! yarn run test stderr:
error Command failed with exit code 6.
error Command failed with exit code 6.

lerna ERR! yarn run test exited 6 in '@requestnetwork/smart-contracts'
error Command failed with exit code 6.
info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Running the tests locally fails (yarn run test) - add docker-compose to run the required services
2 participants