--- a/tests/src/change-collection-owner.test.ts +++ b/tests/src/change-collection-owner.test.ts @@ -31,11 +31,11 @@ itSub('Changing owner changes owner address', async ({helper}) => { const collection = await helper.nft.mintCollection(alice, {name: 'col', description: 'descr', tokenPrefix: 'COL'}); const beforeChanging = await helper.collection.getData(collection.collectionId); - expect(beforeChanging?.normalizedOwner).to.be.equal(alice.address); + expect(beforeChanging?.normalizedOwner).to.be.equal(helper.util.normalizeSubstrateAddress(alice.address)); await collection.changeOwner(alice, bob.address); const afterChanging = await helper.collection.getData(collection.collectionId); - expect(afterChanging?.normalizedOwner).to.be.equal(bob.address); + expect(afterChanging?.normalizedOwner).to.be.equal(helper.util.normalizeSubstrateAddress(bob.address)); }); }); @@ -60,7 +60,7 @@ await expect(changeOwnerTx()).to.be.rejectedWith(/common\.NoPermission/); const afterChanging = await helper.collection.getData(collection.collectionId); - expect(afterChanging?.normalizedOwner).to.be.equal(bob.address); + expect(afterChanging?.normalizedOwner).to.be.equal(helper.util.normalizeSubstrateAddress(bob.address)); }); itSub('New collectionOwner has access to sponsorship management operations in the collection', async ({helper}) => { @@ -68,7 +68,7 @@ await collection.changeOwner(alice, bob.address); const afterChanging = await helper.collection.getData(collection.collectionId); - expect(afterChanging?.normalizedOwner).to.be.equal(bob.address); + expect(afterChanging?.normalizedOwner).to.be.equal(helper.util.normalizeSubstrateAddress(bob.address)); await collection.setSponsor(bob, charlie.address); await collection.confirmSponsorship(charlie); @@ -97,7 +97,7 @@ await collection.changeOwner(alice, bob.address); await collection.changeOwner(bob, charlie.address); const collectionData = await collection.getData(); - expect(collectionData?.normalizedOwner).to.be.equal(charlie.address); + expect(collectionData?.normalizedOwner).to.be.equal(helper.util.normalizeSubstrateAddress(charlie.address)); }); }); @@ -140,7 +140,7 @@ await expect(changeOwnerTx()).to.be.rejectedWith(/common\.NoPermission/); const afterChanging = await helper.collection.getData(collection.collectionId); - expect(afterChanging?.normalizedOwner).to.be.equal(bob.address); + expect(afterChanging?.normalizedOwner).to.be.equal(helper.util.normalizeSubstrateAddress(bob.address)); const setSponsorTx = async () => collection.setSponsor(alice, charlie.address); const confirmSponsorshipTx = async () => collection.confirmSponsorship(alice); --- a/tests/src/createCollection.test.ts +++ b/tests/src/createCollection.test.ts @@ -29,7 +29,7 @@ collection = await helper.rft.mintCollection(signer, options); } const data = await collection.getData(); - expect(data?.normalizedOwner).to.be.equal(signer.address); + expect(data?.normalizedOwner).to.be.equal(helper.util.normalizeSubstrateAddress(signer.address)); expect(data?.name).to.be.equal(options.name); expect(data?.description).to.be.equal(options.description); expect(data?.raw.tokenPrefix).to.be.equal(options.tokenPrefix); @@ -96,7 +96,7 @@ const limits = await collection.getEffectiveLimits(); const raw = data?.raw; - expect(data?.normalizedOwner).to.be.equal(alice.address); + expect(data?.normalizedOwner).to.be.equal(helper.util.normalizeSubstrateAddress(alice.address)); expect(data?.name).to.be.equal('name'); expect(data?.description).to.be.equal('descr'); expect(raw.permissions.access).to.be.equal('AllowList'); --- a/tests/src/createMultipleItems.test.ts +++ b/tests/src/createMultipleItems.test.ts @@ -48,7 +48,7 @@ const tokens = await helper.nft.mintMultipleTokensWithOneOwner(alice, collection.collectionId, {Substrate: alice.address}, args); for (const [i, token] of tokens.entries()) { const tokenData = await token.getData(); - expect(tokenData?.normalizedOwner).to.be.deep.equal({Substrate: alice.address}); + expect(tokenData?.normalizedOwner).to.be.deep.equal({Substrate: helper.util.normalizeSubstrateAddress(alice.address)}); expect(tokenData?.properties[0].value).to.be.equal(args[i].properties[0].value); } }); @@ -116,7 +116,7 @@ const tokens = await helper.nft.mintMultipleTokensWithOneOwner(alice, collection.collectionId, {Substrate: alice.address}, args); for (const [i, token] of tokens.entries()) { const tokenData = await token.getData(); - expect(tokenData?.normalizedOwner).to.be.deep.equal({Substrate: alice.address}); + expect(tokenData?.normalizedOwner).to.be.deep.equal({Substrate: helper.util.normalizeSubstrateAddress(alice.address)}); expect(tokenData?.properties[0].value).to.be.equal(args[i].properties[0].value); } }); @@ -138,7 +138,7 @@ const tokens = await helper.nft.mintMultipleTokensWithOneOwner(alice, collection.collectionId, {Substrate: alice.address}, args); for (const [i, token] of tokens.entries()) { const tokenData = await token.getData(); - expect(tokenData?.normalizedOwner).to.be.deep.equal({Substrate: alice.address}); + expect(tokenData?.normalizedOwner).to.be.deep.equal({Substrate: helper.util.normalizeSubstrateAddress(alice.address)}); expect(tokenData?.properties[0].value).to.be.equal(args[i].properties[0].value); } }); @@ -160,7 +160,7 @@ const tokens = await helper.nft.mintMultipleTokensWithOneOwner(alice, collection.collectionId, {Substrate: alice.address}, args); for (const [i, token] of tokens.entries()) { const tokenData = await token.getData(); - expect(tokenData?.normalizedOwner).to.be.deep.equal({Substrate: alice.address}); + expect(tokenData?.normalizedOwner).to.be.deep.equal({Substrate: helper.util.normalizeSubstrateAddress(alice.address)}); expect(tokenData?.properties[0].value).to.be.equal(args[i].properties[0].value); } });