git.delta.rocks / unique-network / refs/commits / 447d08b0791f

difftreelog

fix misprints

Igor Kozyrev2022-04-21parent: #d3ed694.patch.diff
in: master

3 files changed

modifiedpallets/nonfungible/src/erc.rsdiffbeforeafterboth
36 SelfWeightOf, weights::WeightInfo,36 SelfWeightOf, weights::WeightInfo,
37};37};
3838
39fn error_unsupported_shema_version() -> Error {39fn error_unsupported_schema_version() -> Error {
40 alloc::format!(40 alloc::format!(
41 "Unsupported shema version! Support only {:?}",41 "Unsupported schema version! Support only {:?}",
42 SchemaVersion::ImageURL42 SchemaVersion::ImageURL
43 )43 )
44 .as_str()44 .as_str()
95 #[solidity(rename_selector = "tokenURI")]95 #[solidity(rename_selector = "tokenURI")]
96 fn token_uri(&self, token_id: uint256) -> Result<string> {96 fn token_uri(&self, token_id: uint256) -> Result<string> {
97 if !matches!(self.schema_version, SchemaVersion::ImageURL) {97 if !matches!(self.schema_version, SchemaVersion::ImageURL) {
98 return Err(error_unsupported_shema_version());98 return Err(error_unsupported_schema_version());
99 }99 }
100100
101 self.consume_store_reads(1)?;101 self.consume_store_reads(1)?;
286 token_uri: string,286 token_uri: string,
287 ) -> Result<bool> {287 ) -> Result<bool> {
288 if !matches!(self.schema_version, SchemaVersion::ImageURL) {288 if !matches!(self.schema_version, SchemaVersion::ImageURL) {
289 return Err(error_unsupported_shema_version());289 return Err(error_unsupported_schema_version());
290 }290 }
291291
292 let caller = T::CrossAccountId::from_eth(caller);292 let caller = T::CrossAccountId::from_eth(caller);
431 tokens: Vec<(uint256, string)>,431 tokens: Vec<(uint256, string)>,
432 ) -> Result<bool> {432 ) -> Result<bool> {
433 if !matches!(self.schema_version, SchemaVersion::ImageURL) {433 if !matches!(self.schema_version, SchemaVersion::ImageURL) {
434 return Err(error_unsupported_shema_version());434 return Err(error_unsupported_schema_version());
435 }435 }
436436
437 let caller = T::CrossAccountId::from_eth(caller);437 let caller = T::CrossAccountId::from_eth(caller);
modifiedtests/src/eth/metadata.test.tsdiffbeforeafterboth
--- 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',
modifiedtests/src/setConstOnChainSchema.test.tsdiffbeforeafterboth
--- 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;
     });
   });