difftreelog
fix misprints
in: master
3 files changed
pallets/nonfungible/src/erc.rsdiffbeforeafterboth--- 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<string> {
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<bool> {
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<bool> {
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);
tests/src/eth/metadata.test.tsdiffbeforeafterboth68});68});696970describe('Support ERC721Metadata', () => {70describe('Support ERC721Metadata', () => {71 itWeb3('Check unsupport ERC721Metadata ShemaVersion::Unique', async ({web3, api}) => {71 itWeb3('Check unsupport ERC721Metadata SchemaVersion::Unique', async ({web3, api}) => {72 const collectionId = await createCollectionExpectSuccess({72 const collectionId = await createCollectionExpectSuccess({73 mode: {type: 'NFT'},73 mode: {type: 'NFT'},74 shemaVersion: 'Unique',74 schemaVersion: 'Unique',75 name: 'some_name',75 name: 'some_name',76 tokenPrefix: 'some_prefix',76 tokenPrefix: 'some_prefix',77 });77 });98 receiver,98 receiver,99 nextTokenId,99 nextTokenId,100 'Test URI',100 'Test URI',101 ).call({from: caller})).to.be.rejectedWith('Unsupported shema version! Support only ImageURL');101 ).call({from: caller})).to.be.rejectedWith('Unsupported schema version! Support only ImageURL');102102103 await expect(contract.methods.mintBulkWithTokenURI(103 await expect(contract.methods.mintBulkWithTokenURI(104 receiver,104 receiver,107 [+nextTokenId + 1, 'Test URI 1'],107 [+nextTokenId + 1, 'Test URI 1'],108 [+nextTokenId + 2, 'Test URI 2'],108 [+nextTokenId + 2, 'Test URI 2'],109 ],109 ],110 ).call({from: caller})).to.be.rejectedWith('Unsupported shema version! Support only ImageURL');110 ).call({from: caller})).to.be.rejectedWith('Unsupported schema version! Support only ImageURL');111 });111 });112112113 itWeb3('Check support ERC721Metadata for ShemaVersion::ImageURL', async ({web3, api}) => {113 itWeb3('Check support ERC721Metadata for SchemaVersion::ImageURL', async ({web3, api}) => {114 const collectionId = await createCollectionExpectSuccess({114 const collectionId = await createCollectionExpectSuccess({115 mode: {type: 'NFT'},115 mode: {type: 'NFT'},116 name: 'some_name',116 name: 'some_name',tests/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;
});
});