difftreelog
test transfer already nested token + destroy a non-empty collection + additional refactoring
in: master
7 files changed
tests/package.jsondiffbeforeafterboth1{2 "name": "unique-tests",3 "version": "1.0.0",4 "description": "Unique Chain Tests",5 "main": "",6 "devDependencies": {7 "@polkadot/dev": "0.66.30",8 "@polkadot/ts": "0.4.22",9 "@polkadot/typegen": "8.6.2",10 "@types/chai": "^4.3.1",11 "@types/chai-as-promised": "^7.1.5",12 "@types/mocha": "^9.1.1",13 "@types/node": "^17.0.35",14 "@typescript-eslint/eslint-plugin": "^5.26.0",15 "@typescript-eslint/parser": "^5.26.0",16 "chai": "^4.3.6",17 "eslint": "^8.16.0",18 "mocha": "^10.0.0",19 "ts-node": "^10.8.0",20 "typescript": "^4.7.2"21 },22 "mocha": {23 "timeout": 9999999,24 "require": "ts-node/register"25 },26 "scripts": {27 "lint": "eslint --ext .ts,.js src/",28 "fix": "eslint --ext .ts,.js src/ --fix",29 "test": "mocha --timeout 9999999 -r ts-node/register './src/**/*.test.ts'",30 "testEth": "mocha --timeout 9999999 -r ts-node/register './**/eth/**/*.test.ts'",31 "testEthMarketplace": "mocha --timeout 9999999 -r ts-node/register './**/eth/marketplace/**/*.test.ts'",32 "load": "mocha --timeout 9999999 -r ts-node/register './**/*.load.ts'",33 "loadTransfer": "ts-node src/transfer.nload.ts",34 "testCollision": "mocha --timeout 9999999 -r ts-node/register ./src/collision-tests/*.test.ts",35 "testEvent": "mocha --timeout 9999999 -r ts-node/register ./src/check-event/*.test.ts",36 "testNesting": "mocha --timeout 9999999 -r ts-node/register ./**/nest.test.ts",37 "testUnnesting": "mocha --timeout 9999999 -r ts-node/register ./**/unnest.test.ts",38 "testStructure": "mocha --timeout 9999999 -r ts-node/register ./**/nesting/**.test.ts",39 "testProperties": "mocha --timeout 9999999 -r ts-node/register ./**/properties.test.ts",40 "testMigrationStructure": "mocha --timeout 9999999 -r ts-node/register ./**/nesting/migration-check.test.ts",41 "testAddCollectionAdmin": "mocha --timeout 9999999 -r ts-node/register ./**/addCollectionAdmin.test.ts",42 "testSetSchemaVersion": "mocha --timeout 9999999 -r ts-node/register ./**/setSchemaVersion.test.ts",43 "testSetCollectionLimits": "mocha --timeout 9999999 -r ts-node/register ./**/setCollectionLimits.test.ts",44 "testSetCollectionSponsor": "mocha --timeout 9999999 -r ts-node/register ./**/setCollectionSponsor.test.ts",45 "testConfirmSponsorship": "mocha --timeout 9999999 -r ts-node/register ./**/confirmSponsorship.test.ts",46 "testRemoveCollectionAdmin": "mocha --timeout 9999999 -r ts-node/register ./**/removeCollectionAdmin.test.ts",47 "testRemoveCollectionSponsor": "mocha --timeout 9999999 -r ts-node/register ./**/removeCollectionSponsor.test.ts",48 "testRemoveFromAllowList": "mocha --timeout 9999999 -r ts-node/register ./**/removeFromAllowList.test.ts",49 "testConnection": "mocha --timeout 9999999 -r ts-node/register ./**/connection.test.ts",50 "testContracts": "mocha --timeout 9999999 -r ts-node/register ./**/contracts.test.ts",51 "testCreateItem": "mocha --timeout 9999999 -r ts-node/register ./**/createItem.test.ts",52 "testCreateMultipleItems": "mocha --timeout 9999999 -r ts-node/register ./**/createMultipleItems.test.ts",53 "testCreateMultipleItemsEx": "mocha --timeout 9999999 -r ts-node/register ./**/createMultipleItemsEx.test.ts",54 "testApprove": "mocha --timeout 9999999 -r ts-node/register ./**/approve.test.ts",55 "testTransferFrom": "mocha --timeout 9999999 -r ts-node/register ./**/transferFrom.test.ts",56 "testCreateCollection": "mocha --timeout 9999999 -r ts-node/register ./**/createCollection.test.ts",57 "testToggleContractAllowList": "mocha --timeout 9999999 -r ts-node/register ./**/toggleContractAllowList.test.ts",58 "testAddToContractAllowList": "mocha --timeout 9999999 -r ts-node/register ./**/addToContractAllowList.test.ts",59 "testTransfer": "mocha --timeout 9999999 -r ts-node/register ./**/transfer.test.ts",60 "testBurnItem": "mocha --timeout 9999999 -r ts-node/register ./**/burnItem.test.ts",61 "testSetMintPermission": "mocha --timeout 9999999 -r ts-node/register ./**/setMintPermission.test.ts",62 "testCreditFeesToTreasury": "mocha --timeout 9999999 -r ts-node/register ./**/creditFeesToTreasury.test.ts",63 "testEnableContractSponsoring": "mocha --timeout 9999999 -r ts-node/register ./**/enableContractSponsoring.test.ts",64 "testRemoveFromContractAllowList": "mocha --timeout 9999999 -r ts-node/register ./**/removeFromContractAllowList.test.ts",65 "testSetContractSponsoringRateLimit": "mocha --timeout 9999999 -r ts-node/register ./**/setContractSponsoringRateLimit.test.ts",66 "testSetOffchainSchema": "mocha --timeout 9999999 -r ts-node/register ./**/setOffchainSchema.test.ts",67 "testOverflow": "mocha --timeout 9999999 -r ts-node/register ./**/overflow.test.ts",68 "testSetVariableMetadataSponsoringRateLimit": "mocha --timeout 9999999 -r ts-node/register ./**/setVariableMetadataSponsoringRateLimit.test.ts",69 "testInflation": "mocha --timeout 9999999 -r ts-node/register ./**/inflation.test.ts",70 "testXcmTransfer": "mocha --timeout 9999999 -r ts-node/register ./**/xcmTransfer.test.ts",71 "testPalletPresence": "mocha --timeout 9999999 -r ts-node/register ./**/pallet-presence.test.ts",72 "testBlockProduction": "mocha --timeout 9999999 -r ts-node/register ./**/block-production.test.ts",73 "testEnableDisableTransfers": "mocha --timeout 9999999 -r ts-node/register ./**/enableDisableTransfer.test.ts",74 "testLimits": "mocha --timeout 9999999 -r ts-node/register ./**/limits.test.ts",75 "testEthCreateCollection": "mocha --timeout 9999999 -r ts-node/register ./**/eth/createCollection.test.ts",76 "polkadot-types-fetch-metadata": "curl -H 'Content-Type: application/json' -d '{\"id\":\"1\", \"jsonrpc\":\"2.0\", \"method\": \"state_getMetadata\", \"params\":[]}' http://localhost:9933 > src/interfaces/metadata.json",77 "polkadot-types-from-defs": "ts-node ./node_modules/.bin/polkadot-types-from-defs --endpoint src/interfaces/metadata.json --input src/interfaces/ --package .",78 "polkadot-types-from-chain": "ts-node ./node_modules/.bin/polkadot-types-from-chain --endpoint src/interfaces/metadata.json --output src/interfaces/ --package .",79 "polkadot-types": "echo \"export default {}\" > src/interfaces/lookup.ts && yarn polkadot-types-fetch-metadata && yarn polkadot-types-from-defs && yarn polkadot-types-from-defs && yarn polkadot-types-from-chain"80 },81 "author": "",82 "license": "SEE LICENSE IN ../LICENSE",83 "homepage": "",84 "dependencies": {85 "@polkadot/api": "8.6.2",86 "@polkadot/api-contract": "8.6.2",87 "@polkadot/util-crypto": "9.3.1",88 "bignumber.js": "^9.0.2",89 "chai-as-promised": "^7.1.1",90 "find-process": "^1.4.7",91 "solc": "0.8.14-fixed",92 "web3": "^1.7.3"93 },94 "standard": {95 "globals": [96 "it",97 "assert",98 "beforeEach",99 "afterEach",100 "describe",101 "contract",102 "artifacts"103 ]104 },105 "resolutions": {106 "simple-get": "^4.0.1"107 }108}1{2 "name": "unique-tests",3 "version": "1.0.0",4 "description": "Unique Chain Tests",5 "main": "",6 "devDependencies": {7 "@polkadot/dev": "0.66.30",8 "@polkadot/ts": "0.4.22",9 "@polkadot/typegen": "8.6.2",10 "@types/chai": "^4.3.1",11 "@types/chai-as-promised": "^7.1.5",12 "@types/mocha": "^9.1.1",13 "@types/node": "^17.0.35",14 "@typescript-eslint/eslint-plugin": "^5.26.0",15 "@typescript-eslint/parser": "^5.26.0",16 "chai": "^4.3.6",17 "eslint": "^8.16.0",18 "mocha": "^10.0.0",19 "ts-node": "^10.8.0",20 "typescript": "^4.7.2"21 },22 "mocha": {23 "timeout": 9999999,24 "require": "ts-node/register"25 },26 "scripts": {27 "lint": "eslint --ext .ts,.js src/",28 "fix": "eslint --ext .ts,.js src/ --fix",29 "test": "mocha --timeout 9999999 -r ts-node/register './src/**/*.test.ts'",30 "testEth": "mocha --timeout 9999999 -r ts-node/register './**/eth/**/*.test.ts'",31 "testEthMarketplace": "mocha --timeout 9999999 -r ts-node/register './**/eth/marketplace/**/*.test.ts'",32 "load": "mocha --timeout 9999999 -r ts-node/register './**/*.load.ts'",33 "loadTransfer": "ts-node src/transfer.nload.ts",34 "testCollision": "mocha --timeout 9999999 -r ts-node/register ./src/collision-tests/*.test.ts",35 "testEvent": "mocha --timeout 9999999 -r ts-node/register ./src/check-event/*.test.ts",36 "testNesting": "mocha --timeout 9999999 -r ts-node/register ./**/nest.test.ts",37 "testUnnesting": "mocha --timeout 9999999 -r ts-node/register ./**/unnest.test.ts",38 "testStructure": "mocha --timeout 9999999 -r ts-node/register ./**/nesting/**.test.ts",39 "testProperties": "mocha --timeout 9999999 -r ts-node/register ./**/properties.test.ts",40 "testMigrationStructure": "mocha --timeout 9999999 -r ts-node/register ./**/nesting/migration-check.test.ts",41 "testAddCollectionAdmin": "mocha --timeout 9999999 -r ts-node/register ./**/addCollectionAdmin.test.ts",42 "testSetSchemaVersion": "mocha --timeout 9999999 -r ts-node/register ./**/setSchemaVersion.test.ts",43 "testSetCollectionLimits": "mocha --timeout 9999999 -r ts-node/register ./**/setCollectionLimits.test.ts",44 "testSetCollectionSponsor": "mocha --timeout 9999999 -r ts-node/register ./**/setCollectionSponsor.test.ts",45 "testConfirmSponsorship": "mocha --timeout 9999999 -r ts-node/register ./**/confirmSponsorship.test.ts",46 "testRemoveCollectionAdmin": "mocha --timeout 9999999 -r ts-node/register ./**/removeCollectionAdmin.test.ts",47 "testRemoveCollectionSponsor": "mocha --timeout 9999999 -r ts-node/register ./**/removeCollectionSponsor.test.ts",48 "testRemoveFromAllowList": "mocha --timeout 9999999 -r ts-node/register ./**/removeFromAllowList.test.ts",49 "testConnection": "mocha --timeout 9999999 -r ts-node/register ./**/connection.test.ts",50 "testContracts": "mocha --timeout 9999999 -r ts-node/register ./**/contracts.test.ts",51 "testCreateItem": "mocha --timeout 9999999 -r ts-node/register ./**/createItem.test.ts",52 "testCreateMultipleItems": "mocha --timeout 9999999 -r ts-node/register ./**/createMultipleItems.test.ts",53 "testCreateMultipleItemsEx": "mocha --timeout 9999999 -r ts-node/register ./**/createMultipleItemsEx.test.ts",54 "testApprove": "mocha --timeout 9999999 -r ts-node/register ./**/approve.test.ts",55 "testTransferFrom": "mocha --timeout 9999999 -r ts-node/register ./**/transferFrom.test.ts",56 "testCreateCollection": "mocha --timeout 9999999 -r ts-node/register ./**/createCollection.test.ts",57 "testDestroyCollection": "mocha --timeout 9999999 -r ts-node/register ./**/destroyCollection.test.ts",58 "testToggleContractAllowList": "mocha --timeout 9999999 -r ts-node/register ./**/toggleContractAllowList.test.ts",59 "testAddToContractAllowList": "mocha --timeout 9999999 -r ts-node/register ./**/addToContractAllowList.test.ts",60 "testTransfer": "mocha --timeout 9999999 -r ts-node/register ./**/transfer.test.ts",61 "testBurnItem": "mocha --timeout 9999999 -r ts-node/register ./**/burnItem.test.ts",62 "testSetMintPermission": "mocha --timeout 9999999 -r ts-node/register ./**/setMintPermission.test.ts",63 "testCreditFeesToTreasury": "mocha --timeout 9999999 -r ts-node/register ./**/creditFeesToTreasury.test.ts",64 "testEnableContractSponsoring": "mocha --timeout 9999999 -r ts-node/register ./**/enableContractSponsoring.test.ts",65 "testRemoveFromContractAllowList": "mocha --timeout 9999999 -r ts-node/register ./**/removeFromContractAllowList.test.ts",66 "testSetContractSponsoringRateLimit": "mocha --timeout 9999999 -r ts-node/register ./**/setContractSponsoringRateLimit.test.ts",67 "testSetOffchainSchema": "mocha --timeout 9999999 -r ts-node/register ./**/setOffchainSchema.test.ts",68 "testOverflow": "mocha --timeout 9999999 -r ts-node/register ./**/overflow.test.ts",69 "testSetVariableMetadataSponsoringRateLimit": "mocha --timeout 9999999 -r ts-node/register ./**/setVariableMetadataSponsoringRateLimit.test.ts",70 "testInflation": "mocha --timeout 9999999 -r ts-node/register ./**/inflation.test.ts",71 "testXcmTransfer": "mocha --timeout 9999999 -r ts-node/register ./**/xcmTransfer.test.ts",72 "testPalletPresence": "mocha --timeout 9999999 -r ts-node/register ./**/pallet-presence.test.ts",73 "testBlockProduction": "mocha --timeout 9999999 -r ts-node/register ./**/block-production.test.ts",74 "testEnableDisableTransfers": "mocha --timeout 9999999 -r ts-node/register ./**/enableDisableTransfer.test.ts",75 "testLimits": "mocha --timeout 9999999 -r ts-node/register ./**/limits.test.ts",76 "testEthCreateCollection": "mocha --timeout 9999999 -r ts-node/register ./**/eth/createCollection.test.ts",77 "polkadot-types-fetch-metadata": "curl -H 'Content-Type: application/json' -d '{\"id\":\"1\", \"jsonrpc\":\"2.0\", \"method\": \"state_getMetadata\", \"params\":[]}' http://localhost:9933 > src/interfaces/metadata.json",78 "polkadot-types-from-defs": "ts-node ./node_modules/.bin/polkadot-types-from-defs --endpoint src/interfaces/metadata.json --input src/interfaces/ --package .",79 "polkadot-types-from-chain": "ts-node ./node_modules/.bin/polkadot-types-from-chain --endpoint src/interfaces/metadata.json --output src/interfaces/ --package .",80 "polkadot-types": "echo \"export default {}\" > src/interfaces/lookup.ts && yarn polkadot-types-fetch-metadata && yarn polkadot-types-from-defs && yarn polkadot-types-from-defs && yarn polkadot-types-from-chain"81 },82 "author": "",83 "license": "SEE LICENSE IN ../LICENSE",84 "homepage": "",85 "dependencies": {86 "@polkadot/api": "8.6.2",87 "@polkadot/api-contract": "8.6.2",88 "@polkadot/util-crypto": "9.3.1",89 "bignumber.js": "^9.0.2",90 "chai-as-promised": "^7.1.1",91 "find-process": "^1.4.7",92 "solc": "0.8.14-fixed",93 "web3": "^1.7.3"94 },95 "standard": {96 "globals": [97 "it",98 "assert",99 "beforeEach",100 "afterEach",101 "describe",102 "contract",103 "artifacts"104 ]105 },106 "resolutions": {107 "simple-get": "^4.0.1"108 }109}tests/src/createMultipleItemsEx.test.tsdiffbeforeafterboth--- a/tests/src/createMultipleItemsEx.test.ts
+++ b/tests/src/createMultipleItemsEx.test.ts
@@ -29,13 +29,10 @@
const data = [
{
owner: {substrate: alice.address},
- // constData: '0x0000',
}, {
owner: {substrate: bob.address},
- // constData: '0x2222',
}, {
owner: {substrate: charlie.address},
- // constData: '0x4444',
},
];
@@ -57,15 +54,12 @@
const data = [
{
owner: {substrate: alice.address},
- // constData: '0x1111',
properties: [{key: 'k', value: 'v1'}],
}, {
owner: {substrate: bob.address},
- // constData: '0x2222',
properties: [{key: 'k', value: 'v2'}],
}, {
owner: {substrate: charlie.address},
- // constData: '0x4444',
properties: [{key: 'k', value: 'v3'}],
},
];
@@ -88,15 +82,12 @@
const data = [
{
owner: {substrate: alice.address},
- // constData: '0x0000',
properties: [{key: 'k', value: 'v1'}],
}, {
owner: {substrate: bob.address},
- // constData: '0x2222',
properties: [{key: 'k', value: 'v2'}],
}, {
owner: {substrate: charlie.address},
- // constData: '0x4444',
properties: [{key: 'k', value: 'v3'}],
},
];
@@ -119,15 +110,12 @@
const data = [
{
owner: {substrate: alice.address},
- // constData: '0x0000',
properties: [{key: 'k', value: 'v1'}],
}, {
owner: {substrate: bob.address},
- // constData: '0x2222',
properties: [{key: 'k', value: 'v2'}],
}, {
owner: {substrate: charlie.address},
- // constData: '0x4444',
properties: [{key: 'k', value: 'v3'}],
},
];
@@ -272,13 +260,10 @@
const data = [
{
owner: {substrate: alice.address},
- // constData: '0x0000',
}, {
owner: {substrate: bob.address},
- // constData: '0x2222',
}, {
owner: {substrate: charlie.address},
- // constData: '0x4444',
},
];
@@ -300,13 +285,10 @@
const data = [
{
owner: {substrate: alice.address},
- // constData: '0x0000',
}, {
owner: {substrate: bob.address},
- // constData: '0x2222',
}, {
owner: {substrate: charlie.address},
- // constData: '0x4444',
},
];
tests/src/destroyCollection.test.tsdiffbeforeafterboth--- a/tests/src/destroyCollection.test.ts
+++ b/tests/src/destroyCollection.test.ts
@@ -25,6 +25,7 @@
setCollectionLimitsExpectSuccess,
addCollectionAdminExpectSuccess,
getCreatedCollectionCount,
+ createItemExpectSuccess,
} from './util/helpers';
chai.use(chaiAsPromised);
@@ -83,4 +84,10 @@
await destroyCollectionExpectFailure(collectionId, '//Alice');
});
+ it('fails when a collection still has a token', async () => {
+ const collectionId = await createCollectionExpectSuccess();
+ await createItemExpectSuccess(alice, collectionId, 'NFT');
+
+ await destroyCollectionExpectFailure(collectionId, '//Alice');
+ });
});
tests/src/nesting/migration-check.test.tsdiffbeforeafterboth--- a/tests/src/nesting/migration-check.test.ts
+++ b/tests/src/nesting/migration-check.test.ts
@@ -31,12 +31,12 @@
name: strToUTF16('Mojave Pictures'),
description: strToUTF16('$2.2 billion power plant!'),
tokenPrefix: '0x0002030',
- offchainSchema: '0x111111',
- schemaVersion: 'Unique',
+ //offchainSchema: '0x111111',
+ //schemaVersion: 'Unique',
limits: {
accountTokenOwnershipLimit: 3,
},
- constOnChainSchema: '0x333333',
+ //constOnChainSchema: '0x333333',
});
const events = await submitTransactionAsync(alice, tx);
const result = getCreateCollectionResult(events);
@@ -96,17 +96,17 @@
const collectionNew = (await api.query.common.collectionById(collectionId)).toJSON() as any;
// Make sure the extra fields are what they should be
- const constOnChainSchema = await api.query.common.collectionData(collectionId, 'ConstOnChainSchema');
- const offchainSchema = await api.query.common.collectionData(collectionId, 'OffchainSchema');
+ //const constOnChainSchema = await api.query.common.collectionData(collectionId, 'ConstOnChainSchema');
+ //const offchainSchema = await api.query.common.collectionData(collectionId, 'OffchainSchema');
- expect(constOnChainSchema.toHex()).to.be.deep.equal(collectionOld.constOnChainSchema);
- expect(offchainSchema.toHex()).to.be.deep.equal(collectionOld.offchainSchema);
+ //expect(constOnChainSchema.toHex()).to.be.deep.equal(collectionOld.constOnChainSchema);
+ //expect(offchainSchema.toHex()).to.be.deep.equal(collectionOld.offchainSchema);
expect(collectionNew).to.have.nested.property('limits.nestingRule');
// Get rid of extra fields to perform comparison on the rest of the collection
delete collectionNew.limits.nestingRule;
- delete collectionOld.constOnChainSchema;
- delete collectionOld.offchainSchema;
+ //delete collectionOld.constOnChainSchema;
+ //delete collectionOld.offchainSchema;
expect(collectionNew).to.be.deep.equal(collectionOld);
});
tests/src/nesting/nest.test.tsdiffbeforeafterboth--- a/tests/src/nesting/nest.test.ts
+++ b/tests/src/nesting/nest.test.ts
@@ -10,6 +10,7 @@
enablePublicMintingExpectSuccess,
getTokenOwner,
getTopmostTokenOwner,
+ normalizeAccountId,
setCollectionPermissionsExpectSuccess,
transferExpectFailure,
transferExpectSuccess,
@@ -28,7 +29,7 @@
});
});
- it('Performs the full suite: bundles a token, transfers, and allows to unnest', async () => {
+ it('Performs the full suite: bundles a token, transfers, and unnests', async () => {
await usingApi(async api => {
const collection = await createCollectionExpectSuccess({mode: {type: 'NFT'}});
await setCollectionPermissionsExpectSuccess(alice, collection, {nesting: 'Owner'});
@@ -58,6 +59,33 @@
});
});
+ it('Transfers an already bundled token', async () => {
+ await usingApi(async api => {
+ const collection = await createCollectionExpectSuccess({mode: {type: 'NFT'}});
+ await setCollectionPermissionsExpectSuccess(alice, collection, {nesting: 'Owner'});
+
+ const tokenA = await createItemExpectSuccess(alice, collection, 'NFT');
+ const tokenB = await createItemExpectSuccess(alice, collection, 'NFT');
+
+ // Create a nested token
+ const tokenC = await createItemExpectSuccess(alice, collection, 'NFT', {Ethereum: tokenIdToAddress(collection, tokenA)});
+ expect(await getTopmostTokenOwner(api, collection, tokenC)).to.be.deep.equal({Substrate: alice.address});
+ expect(await getTokenOwner(api, collection, tokenC)).to.be.deep.equal({Ethereum: tokenIdToAddress(collection, tokenA).toLowerCase()});
+
+ // Transfer the nested token to another token
+ await expect(executeTransaction(
+ api,
+ alice,
+ api.tx.unique.transferFrom(
+ normalizeAccountId({Ethereum: tokenIdToAddress(collection, tokenA)}),
+ normalizeAccountId({Ethereum: tokenIdToAddress(collection, tokenB)}),
+ collection, tokenC, 1),
+ )).to.not.be.rejected;
+ expect(await getTopmostTokenOwner(api, collection, tokenC)).to.be.deep.equal({Substrate: alice.address});
+ expect(await getTokenOwner(api, collection, tokenC)).to.be.deep.equal({Ethereum: tokenIdToAddress(collection, tokenB).toLowerCase()});
+ });
+ });
+
// ---------- Non-Fungible ----------
it('NFT: allows an Owner to nest/unnest their token', async () => {
tests/src/setChainLimits.test.tsdiffbeforeafterboth--- a/tests/src/setChainLimits.test.ts
+++ b/tests/src/setChainLimits.test.ts
@@ -43,8 +43,6 @@
nftSponsorTransferTimeout: 1,
fungibleSponsorTransferTimeout: 1,
refungibleSponsorTransferTimeout: 1,
- offchainSchemaLimit: 1,
- constOnChainSchemaLimit: 1,
};
});
});
tests/src/util/helpers.tsdiffbeforeafterboth--- a/tests/src/util/helpers.ts
+++ b/tests/src/util/helpers.ts
@@ -135,8 +135,8 @@
nftSponsorTransferTimeout: number;
fungibleSponsorTransferTimeout: number;
refungibleSponsorTransferTimeout: number;
- offchainSchemaLimit: number;
- constOnChainSchemaLimit: number;
+ //offchainSchemaLimit: number;
+ //constOnChainSchemaLimit: number;
}
export interface IReFungibleTokenDataType {
@@ -310,7 +310,6 @@
name: string,
description: string,
tokenPrefix: string,
- schemaVersion: string,
properties?: Array<Property>,
propPerm?: Array<PropertyPermission>
};
@@ -320,7 +319,6 @@
mode: {type: 'NFT'},
name: 'name',
tokenPrefix: 'prefix',
- schemaVersion: 'ImageURL',
};
export async function createCollectionExpectSuccess(params: Partial<CreateCollectionParams> = {}): Promise<number> {
@@ -780,25 +778,8 @@
const result = getGenericResult(events);
expect(result.success).to.be.false;
- });
-}
-
-/*export async function setOffchainSchemaExpectSuccess(sender: IKeyringPair, collectionId: number, data: number[]) {
- await usingApi(async (api) => {
- const tx = api.tx.unique.setOffchainSchema(collectionId, '0x' + Buffer.from(data).toString('hex'));
- const events = await submitTransactionAsync(sender, tx);
- const result = getGenericResult(events);
-
- expect(result.success).to.be.true;
});
}
-
-export async function setOffchainSchemaExpectFailure(sender: IKeyringPair, collectionId: number, data: number[]) {
- await usingApi(async (api) => {
- const tx = api.tx.unique.setOffchainSchema(collectionId, '0x' + Buffer.from(data).toString('hex'));
- await expect(submitTransactionExpectFailAsync(sender, tx)).to.be.rejected;
- });
-}*/
export interface CreateFungibleData {
readonly Value: bigint;
@@ -1110,13 +1091,6 @@
): Promise<string[]> {
return (await api.rpc.unique.adminlist(collectionId)).toHuman() as any;
}
-/*export async function getConstMetadata(
- api: ApiPromise,
- collectionId: number,
- tokenId: number,
-): Promise<number[]> {
- return [...(await api.rpc.unique.constMetadata(collectionId, tokenId))];
-}*/
export async function getTokenProperties(
api: ApiPromise,
collectionId: number,