--- a/pallets/nonfungible/src/erc.rs +++ b/pallets/nonfungible/src/erc.rs @@ -36,9 +36,9 @@ SelfWeightOf, weights::WeightInfo, }; -fn error_unsupported_shema_version() -> Error { +fn error_unsupported_schema_version() -> Error { alloc::format!( - "Unsupported shema version! Support only {:?}", + "Unsupported schema version! Support only {:?}", SchemaVersion::ImageURL ) .as_str() @@ -95,7 +95,7 @@ #[solidity(rename_selector = "tokenURI")] fn token_uri(&self, token_id: uint256) -> Result { if !matches!(self.schema_version, SchemaVersion::ImageURL) { - return Err(error_unsupported_shema_version()); + return Err(error_unsupported_schema_version()); } self.consume_store_reads(1)?; @@ -286,7 +286,7 @@ token_uri: string, ) -> Result { if !matches!(self.schema_version, SchemaVersion::ImageURL) { - return Err(error_unsupported_shema_version()); + return Err(error_unsupported_schema_version()); } let caller = T::CrossAccountId::from_eth(caller); @@ -431,7 +431,7 @@ tokens: Vec<(uint256, string)>, ) -> Result { if !matches!(self.schema_version, SchemaVersion::ImageURL) { - return Err(error_unsupported_shema_version()); + return Err(error_unsupported_schema_version()); } let caller = T::CrossAccountId::from_eth(caller); --- a/tests/src/eth/metadata.test.ts +++ b/tests/src/eth/metadata.test.ts @@ -68,10 +68,10 @@ }); describe('Support ERC721Metadata', () => { - itWeb3('Check unsupport ERC721Metadata ShemaVersion::Unique', async ({web3, api}) => { + itWeb3('Check unsupport ERC721Metadata SchemaVersion::Unique', async ({web3, api}) => { const collectionId = await createCollectionExpectSuccess({ mode: {type: 'NFT'}, - shemaVersion: 'Unique', + schemaVersion: 'Unique', name: 'some_name', tokenPrefix: 'some_prefix', }); @@ -98,7 +98,7 @@ receiver, nextTokenId, 'Test URI', - ).call({from: caller})).to.be.rejectedWith('Unsupported shema version! Support only ImageURL'); + ).call({from: caller})).to.be.rejectedWith('Unsupported schema version! Support only ImageURL'); await expect(contract.methods.mintBulkWithTokenURI( receiver, @@ -107,10 +107,10 @@ [+nextTokenId + 1, 'Test URI 1'], [+nextTokenId + 2, 'Test URI 2'], ], - ).call({from: caller})).to.be.rejectedWith('Unsupported shema version! Support only ImageURL'); + ).call({from: caller})).to.be.rejectedWith('Unsupported schema version! Support only ImageURL'); }); - itWeb3('Check support ERC721Metadata for ShemaVersion::ImageURL', async ({web3, api}) => { + itWeb3('Check support ERC721Metadata for SchemaVersion::ImageURL', async ({web3, api}) => { const collectionId = await createCollectionExpectSuccess({ mode: {type: 'NFT'}, name: 'some_name', --- a/tests/src/setConstOnChainSchema.test.ts +++ b/tests/src/setConstOnChainSchema.test.ts @@ -32,16 +32,16 @@ let alice: IKeyringPair; let bob: IKeyringPair; -let shema: any; -let largeShema: any; +let schema: any; +let largeSchema: any; before(async () => { await usingApi(async () => { const keyring = new Keyring({type: 'sr25519'}); alice = keyring.addFromUri('//Alice'); bob = keyring.addFromUri('//Bob'); - shema = '0x31'; - largeShema = new Array(1024 * 1024 + 10).fill(0xff); + schema = '0x31'; + largeSchema = new Array(1024 * 1024 + 10).fill(0xff); }); }); describe('Integration Test ext. setConstOnChainSchema()', () => { @@ -51,8 +51,8 @@ const collectionId = await createCollectionExpectSuccess(); const collection = await queryCollectionExpectSuccess(api, collectionId); expect(collection.owner.toString()).to.be.eq(alice.address); - const setShema = api.tx.unique.setConstOnChainSchema(collectionId, shema); - await submitTransactionAsync(alice, setShema); + const setSchema = api.tx.unique.setConstOnChainSchema(collectionId, schema); + await submitTransactionAsync(alice, setSchema); }); }); @@ -62,18 +62,18 @@ const collection = await queryCollectionExpectSuccess(api, collectionId); expect(collection.owner.toString()).to.be.eq(alice.address); await addCollectionAdminExpectSuccess(alice, collectionId, bob.address); - const setShema = api.tx.unique.setConstOnChainSchema(collectionId, shema); - await submitTransactionAsync(bob, setShema); + const setSchema = api.tx.unique.setConstOnChainSchema(collectionId, schema); + await submitTransactionAsync(bob, setSchema); }); }); it('Checking collection data using the ConstOnChainSchema parameter', async () => { await usingApi(async (api) => { const collectionId = await createCollectionExpectSuccess(); - const setShema = api.tx.unique.setConstOnChainSchema(collectionId, shema); - await submitTransactionAsync(alice, setShema); + const setSchema = api.tx.unique.setConstOnChainSchema(collectionId, schema); + await submitTransactionAsync(alice, setSchema); const collection = await queryCollectionExpectSuccess(api, collectionId); - expect(collection.constOnChainSchema.toString()).to.be.eq(shema); + expect(collection.constOnChainSchema.toString()).to.be.eq(schema); }); }); }); @@ -84,8 +84,8 @@ await usingApi(async (api) => { // tslint:disable-next-line: radix const collectionId = await getCreatedCollectionCount(api) + 1; - const setShema = api.tx.unique.setConstOnChainSchema(collectionId, shema); - await expect(submitTransactionExpectFailAsync(alice, setShema)).to.be.rejected; + const setSchema = api.tx.unique.setConstOnChainSchema(collectionId, schema); + await expect(submitTransactionExpectFailAsync(alice, setSchema)).to.be.rejected; }); }); @@ -93,16 +93,16 @@ await usingApi(async (api) => { const collectionId = await createCollectionExpectSuccess(); await destroyCollectionExpectSuccess(collectionId); - const setShema = api.tx.unique.setConstOnChainSchema(collectionId, shema); - await expect(submitTransactionExpectFailAsync(alice, setShema)).to.be.rejected; + const setSchema = api.tx.unique.setConstOnChainSchema(collectionId, schema); + await expect(submitTransactionExpectFailAsync(alice, setSchema)).to.be.rejected; }); }); it('Set invalid data in schema (size too large:> 1MB)', async () => { await usingApi(async (api) => { const collectionId = await createCollectionExpectSuccess(); - const setShema = api.tx.unique.setConstOnChainSchema(collectionId, largeShema); - await expect(submitTransactionExpectFailAsync(alice, setShema)).to.be.rejected; + const setSchema = api.tx.unique.setConstOnChainSchema(collectionId, largeSchema); + await expect(submitTransactionExpectFailAsync(alice, setSchema)).to.be.rejected; }); }); @@ -111,8 +111,8 @@ const collectionId = await createCollectionExpectSuccess(); const collection = await queryCollectionExpectSuccess(api, collectionId); expect(collection.owner.toString()).to.be.eq(alice.address); - const setShema = api.tx.unique.setConstOnChainSchema(collectionId, shema); - await expect(submitTransactionExpectFailAsync(bob, setShema)).to.be.rejected; + const setSchema = api.tx.unique.setConstOnChainSchema(collectionId, schema); + await expect(submitTransactionExpectFailAsync(bob, setSchema)).to.be.rejected; }); });