Project

General

Profile

Feature improvement #15453

Updated by Peter Mačuga 7 months ago

Create tests for asset helper, accommodate as many test cases as you can think of, main test cases include: 

 * No collection 
 ** * * create new collection - handle if metadata fetch fails (emit warning logs, still handle the deposit correctly) 

 - No AssetType - handle ERC721 and ERC1155 standards differently, test cases to test correct asset type creation, only need 1 per combination of contract_address, blockchain and token_id 
 -- ERC721 
 --- sum of all assets.counts = 1, if you try to deposit to the same wallet emit warning and cancel deposit (possibly log that it was cancelled and for what reason) 
 --- if you try to deposit delta > 1, emit error 
 -- ERC1155  

 - No Asset 
 -- tests for is_virtual_asset T/F 
 -- tests for correct count 
 -- tests for single asset deposit/withdrawal 
 -- tests for multiple asset deposit/withdrawal 

 - Asset already exits 
 -- similar to no asset tests cases 


 New features: 
 - Traceback parameter in request - making it possible to trace the source of action call 
 - cancelled transaction, transactions that were not succesful, however dont need to repeated 
 - checks for ERC721, described above, ideally create a function that handles this, depending on collection.contract_type, could be a function in collection/asset_type or in one of the DTOs, up to you

Back