Closed mosmartin closed 11 months ago
Merging #9014 (5fbae3f) into release/6.1.0 (2eabd20) will decrease coverage by
0.01%
. The diff coverage is100.00%
.
@@ Coverage Diff @@
## release/6.1.0 #9014 +/- ##
=================================================
- Coverage 84.34% 84.33% -0.01%
=================================================
Files 652 652
Lines 23976 23961 -15
Branches 3487 3485 -2
=================================================
- Hits 20223 20208 -15
Misses 3753 3753
Files | Coverage Δ | |
---|---|---|
...amework/src/modules/nft/cc_commands/cc_transfer.ts | 97.33% <100.00%> (-0.26%) |
:arrow_down: |
framework/src/modules/nft/internal_method.ts | 97.22% <100.00%> (+0.07%) |
:arrow_up: |
framework/src/modules/nft/method.ts | 98.37% <100.00%> (-0.04%) |
:arrow_down: |
framework/src/modules/nft/module.ts | 85.60% <100.00%> (-0.34%) |
:arrow_down: |
I think it'd be nice to add unit test to check if NFT has duplicate module attributes for these 2 scenarios :
- When a foreign NFT is received (lisk-sdk/framework/src/modules/nft/cc_commands/cc_transfer.ts#L142-L145)
- When a foreign NFT is bounced (lisk-sdk/framework/src/modules/nft/cc_commands/cc_transfer.ts#L149-L152)
@Incede for the first test, isn't it covered by
it('should reject and emit unsuccessful ccm transfer event if nft chain id does not equal own chain id and nft is not supported', async () => {...}
?
I've also noticed that the CCM_STATUS_CODE_OK
constant here is used in the function and CCM_STATUS_OK
used in the tests. Is this the way it should be?
I think it'd be nice to add unit test to check if NFT has duplicate module attributes for these 2 scenarios :
- When a foreign NFT is received (lisk-sdk/framework/src/modules/nft/cc_commands/cc_transfer.ts#L142-L145)
- When a foreign NFT is bounced (lisk-sdk/framework/src/modules/nft/cc_commands/cc_transfer.ts#L149-L152)
@Incede for the first test, isn't it covered by
it('should reject and emit unsuccessful ccm transfer event if nft chain id does not equal own chain id and nft is not supported', async () => {...}
?
I don't think the test case you mention is related to any of the 2 scenarios :
plus my suggestion is to check if NFT has duplicate module attributes for these 2 scenarios which isn't being currently checked, since the original issue was primarily about allowing "duplicate module attributes" and if the suggested test was already there the issue would have been caught before. Although I understand that the function createNFTEntry
is already tested for duplicate module attributes I thought it'd be nice to test it again here for the sake of this issue.
What was the problem?
This PR resolves #9004
How was it solved?
createNFTEntry
,createEscrowEntry
andcreateUserEntry
methods of theInternalMethod
classhasDuplicateModuleNames
method to theInternalMethod
classexecute
method of theCrossChainTransferCommand
classcreate
method of theNFTMethod
classinitGenesisState
of theNFTModule
classHow was it tested?
Added and updated existing tests