difftreelog
Merge pull request #46 from usetech-llc/feature/NFTPAR-242_destroy_collection_test
in: master
NFTPAR-242 Add destroy collection integration tests
4 files changed
node/src/chain_spec.rsdiffbeforeafterboth45 let mut properties = Map::new();45 let mut properties = Map::new();46 properties.insert("tokenSymbol".into(), "UniqueTest".into());46 properties.insert("tokenSymbol".into(), "UniqueTest".into());47 properties.insert("tokenDecimals".into(), 15.into());47 properties.insert("tokenDecimals".into(), 15.into());48 properties.insert("ss58Format".into(), 0.into());48 properties.insert("ss58Format".into(), 42.into()); // Generic Substrate wildcard (SS58 checksum preimage)494950 Ok(ChainSpec::from_genesis(50 Ok(ChainSpec::from_genesis(51 // Name51 // Nametests/src/accounts.tsdiffbeforeafterboth1export const bobsPublicKey = '5FHneW46xGXgs5mUiveU4sbTyGBzmstUspZC92UhjJM694ty';1export const bobsPublicKey = '5FHneW46xGXgs5mUiveU4sbTyGBzmstUspZC92UhjJM694ty';2export const alicesPublicKey = '5GrwvaEF5zXb26Fz9rcQpDWS57CtERHpNehXCPcNoHGKutQY';2export const alicesPublicKey = '5GrwvaEF5zXb26Fz9rcQpDWS57CtERHpNehXCPcNoHGKutQY';3export const ferdiesPublicKey = '5CiPPseXPECbkjWCa6MnjNokrgYjMqmKndv2rSnekmSK2DjL';3export const ferdiesPublicKey = '5CiPPseXPECbkjWCa6MnjNokrgYjMqmKndv2rSnekmSK2DjL';44export const nullPublicKey = '5C4hrfjw9DjXZTzV3MwzrrAr9P1MJhSrvWGWqi1eSuyUpnhM';tests/src/destroyCollection.test.tsdiffbeforeafterbothno changes
tests/src/util/helpers.tsdiffbeforeafterboth52 return result;52 return result;53}53}545455export async function createCollectionExpectSuccess(name: string, description: string, tokenPrefix: string, mode: string) {55export async function createCollectionExpectSuccess(name: string, description: string, tokenPrefix: string, mode: string): Promise<number> {56 let collectionId: number = 0;56 await usingApi(async (api) => {57 await usingApi(async (api) => {57 // Get number of collections before the transaction58 // Get number of collections before the transaction58 const AcollectionCount = parseInt((await api.query.nft.createdCollectionCount()).toString());59 const AcollectionCount = parseInt((await api.query.nft.createdCollectionCount()).toString());79 expect(utf16ToStr(collection.Description)).to.be.equal(description);80 expect(utf16ToStr(collection.Description)).to.be.equal(description);80 expect(hexToStr(collection.TokenPrefix)).to.be.equal(tokenPrefix);81 expect(hexToStr(collection.TokenPrefix)).to.be.equal(tokenPrefix);8283 collectionId = result.collectionId;81 });84 });8586 return collectionId;82}87}83 88 84export async function createCollectionExpectFailure(name: string, description: string, tokenPrefix: string, mode: string) {89export async function createCollectionExpectFailure(name: string, description: string, tokenPrefix: string, mode: string) {