FIP-41 Development testing guide

This document will contain the testing requirements and procedures and a summary of any testing issues discovered during the design and implementation of FIP-41.

 

Build verification testing for FIP-41

The following tests are being run to verify builds for FIP-41.

NOTE (for FIP-41 Please copy paste the below require operations into your index.js and remove the existing tests)

Build testing is being performed whenever the dev branches are re-based for the effort.

require('./tests/addaddress.js');

require('./tests/fees.js');

require('./tests/producer.js');

require('./tests/pushtransaction.js');

require('./tests/ram.js');

require('./tests/register-fio-address.js');

require('./tests/register-fio-domain.js');

require('./tests/transfer-tokens.js');

require('./tests/vote.js');

require('./tests/action-whitelisting.js');

require('./tests/tpid.js');

require('./tests/nft-sdk-tests.js');

require('./tests/fee-distribution.js');

require('./tests/locks-transfer-locked-tokens-large-grants.js');

require('./tests/stake-general-locked-tokens.js');

 

Expected build test results

the tests should run without failures being reported.

NOTE – some tests throw exceptions that are handled in the test, so the test does not fail, these failures can be ignored during development of FIP-41

 

 

Testing scenarios for merging of locking periods trnsloctoks

  1. size 0 periods is error for op1

  2. size 0 periods is error for op2

  3. size 0 periods for op1 and op2 is error

  4. insert locks first time into existing account. verify locks

  5. insert duplicate lock into test 2 results, verify that a merge takes place with correct durations.

  6. insert operator 1 lock periods are 1 period longer than operator 2 locks, verify correct merge.

  7. op1 has all period durations less than op2 verify proper merge

  8. op2 has all period durations less than op1 verify proper merge.

  9. insert a duplicate duration in first item in op1 and first item op2, verify correct merge

  10. insert a duplicate duration in first item in op1 and last item in op2, verify correct merge

  11. insert a duplicate duration in second item in op1 and first item in op2, verify correct merge

  12. insert a duplicate duration in last item in op1and last item in op2, verify correct merge.

  13. total periods greater then 50 in both periods to be merged (fail test).

  14. invalid periods passed into transfer locked to pre-existing account. (fail test)

  15. max test, verify proper merge of 25 periods in each operator.

  16. MORE TESTS COMING SOON!!!

 

 

Testing of completed changes

 

test the following use cases.

  1. send lock tokens to existing account without any locked tokens.

  2. send lock tokens to existing account with locked tokens.

  3. send lock tokens to non existing account.

 

for clearing of locks test the following.

  1. send lock tokens to non existing account.

  2. allow the lock tokens to mature (wait).

  3. perform transfer of the locked tokens.

  4. see that after the transfer the lock is removed and no longer exists (because it matured).

  5. Verify remgenlock cannot be called by non token accounts.

 

performance testing

lets load the system with alot of locks (20k locks).

lets load the system with alot of users.

lets make lots of accounts with lock grants that are matured.

lets then do calls that collect fees on all of these accounts in a rapid fire manner (try to get lots of fee collections into blocks on the chain that are triggering clearing of the locks for these accounts).

we should see that the transactions succeed without impacting the chain.

 

this testing approach will be reviewed with Eric and ben, and we will try to flush out more useful test cases to be used during development.