Polkadex icon indicating copy to clipboard operation
Polkadex copied to clipboard

Testing OCEX pallet

Open felixfaisal opened this issue 2 years ago • 1 comments

This PR adds unit tests for the OCEX pallet extrinsics

felixfaisal avatar Jul 27 '22 22:07 felixfaisal

The unit tests failure for register_encalve will be addressed in #482

felixfaisal avatar Aug 03 '22 05:08 felixfaisal

Hey @serhii-temchenko the transfers are happening either using the Balances pallet or Assets pallet, Asserting balances would be like writing unit tests for these pallets and not related to our pallet. These pallets already have unit tests provided by Parity. It is redundant work basically.

felixfaisal avatar Aug 16 '22 06:08 felixfaisal

Hey @serhii-temchenko the transfers are happening either using the Balances pallet or Assets pallet, Asserting balances would be like writing unit tests for these pallets and not related to our pallet. These pallets already have unit tests provided by Parity. It is redundant work basically.

Hey @felixfaisal. I'm not saying to test all cases of underlying used third party library which making direct transactions, I'm saying that expected result should be tested, we need to test that transaction method was called, we are testing a "black box" code so we don't care about how it was implemented internally (with usage of third-party library or our concrete implementation). Basically if I will remove call of transaction method - tests will pass checks without failing and we don't need this. You can easily tests this cases, you have known balance before transaction, just run test and copy/paste account balance after transaction and hardcode expected value.

serhii-temchenko avatar Aug 16 '22 21:08 serhii-temchenko

Balance assertions done, Please take a look @serhii-temchenko

felixfaisal avatar Aug 19 '22 03:08 felixfaisal

@felixfaisal Please resolve conflicts.

serhii-temchenko avatar Aug 19 '22 07:08 serhii-temchenko

@felixfaisal there are list of unresolved comments like this one. I assume that they are collapsed on your screen and you missed them? Please address all comments and if it was resolved - click Resolve Conversation.

serhii-temchenko avatar Aug 19 '22 08:08 serhii-temchenko

Added new commit to include RPC for withdrawal as it was a part of #483

felixfaisal avatar Aug 25 '22 07:08 felixfaisal