git.delta.rocks / unique-network / refs/commits / 3ce311c312ce

difftreelog

test query properties rpc

Daniel Shiposha2022-09-29parent: #e899eee.patch.diff
in: master

3 files changed

modifiedtests/package.jsondiffbeforeafterboth
38 "testNesting": "mocha --timeout 9999999 -r ts-node/register ./**/nest.test.ts",38 "testNesting": "mocha --timeout 9999999 -r ts-node/register ./**/nest.test.ts",
39 "testUnnesting": "mocha --timeout 9999999 -r ts-node/register ./**/unnest.test.ts",39 "testUnnesting": "mocha --timeout 9999999 -r ts-node/register ./**/unnest.test.ts",
40 "testStructure": "mocha --timeout 9999999 -r ts-node/register ./**/nesting/**.test.ts",40 "testStructure": "mocha --timeout 9999999 -r ts-node/register ./**/nesting/**.test.ts",
41 "testProperties": "mocha --timeout 9999999 -r ts-node/register ./**/properties.test.ts",41 "testProperties": "mocha --timeout 9999999 -r ts-node/register ./**/properties.test.ts ./**/getPropertiesRpc.test.ts",
42 "testMigration": "mocha --timeout 9999999 -r ts-node/register ./**/nesting/migration-check.test.ts",42 "testMigration": "mocha --timeout 9999999 -r ts-node/register ./**/nesting/migration-check.test.ts",
43 "testRmrk": "mocha --timeout 9999999 -r ts-node/register ./**/rmrk/**.test.ts",43 "testRmrk": "mocha --timeout 9999999 -r ts-node/register ./**/rmrk/**.test.ts",
44 "testAddCollectionAdmin": "mocha --timeout 9999999 -r ts-node/register ./**/addCollectionAdmin.test.ts",44 "testAddCollectionAdmin": "mocha --timeout 9999999 -r ts-node/register ./**/addCollectionAdmin.test.ts",
addedtests/src/getPropertiesRpc.test.tsdiffbeforeafterboth

no changes

modifiedtests/src/util/playgrounds/unique.tsdiffbeforeafterboth
926 * @example getProperties(1219, ['location', 'date', 'time', 'isParadise']);926 * @example getProperties(1219, ['location', 'date', 'time', 'isParadise']);
927 * @returns array of key-value pairs927 * @returns array of key-value pairs
928 */928 */
929 async getProperties(collectionId: number, propertyKeys: string[] | null = null): Promise<IProperty[]> {929 async getProperties(collectionId: number, propertyKeys?: string[] | null): Promise<IProperty[]> {
930 return (await this.helper.callRpc('api.rpc.unique.collectionProperties', [collectionId, ...(propertyKeys === null ? [] : [propertyKeys])])).toHuman();930 return (await this.helper.callRpc('api.rpc.unique.collectionProperties', [collectionId, propertyKeys])).toHuman();
931 }931 }
932932
933 /**933 /**
1208 * @example getTokenProperties(1219, ['location', 'date', 'time', 'isParadise']);1208 * @example getTokenProperties(1219, ['location', 'date', 'time', 'isParadise']);
1209 * @returns array of key-value pairs1209 * @returns array of key-value pairs
1210 */1210 */
1211 async getTokenProperties(collectionId: number, tokenId: number, propertyKeys: string[] | null = null): Promise<IProperty[]> {1211 async getTokenProperties(collectionId: number, tokenId: number, propertyKeys?: string[] | null): Promise<IProperty[]> {
1212 return (await this.helper.callRpc('api.rpc.unique.tokenProperties', [collectionId, tokenId, ...(propertyKeys === null ? [] : [propertyKeys])])).toHuman();1212 return (await this.helper.callRpc('api.rpc.unique.tokenProperties', [collectionId, tokenId, propertyKeys])).toHuman();
1213 }1213 }
12141214
1215 /**1215 /**
2265 return await this.helper.collection.getEffectiveLimits(this.collectionId);2265 return await this.helper.collection.getEffectiveLimits(this.collectionId);
2266 }2266 }
22672267
2268 async getProperties(propertyKeys: string[] | null = null) {2268 async getProperties(propertyKeys?: string[] | null) {
2269 return await this.helper.collection.getProperties(this.collectionId, propertyKeys);2269 return await this.helper.collection.getProperties(this.collectionId, propertyKeys);
2270 }2270 }
22712271
2364 return await this.helper.nft.getPropertyPermissions(this.collectionId, propertyKeys);2364 return await this.helper.nft.getPropertyPermissions(this.collectionId, propertyKeys);
2365 }2365 }
23662366
2367 async getTokenProperties(tokenId: number, propertyKeys: string[] | null = null) {2367 async getTokenProperties(tokenId: number, propertyKeys?: string[] | null) {
2368 return await this.helper.nft.getTokenProperties(this.collectionId, tokenId, propertyKeys);2368 return await this.helper.nft.getTokenProperties(this.collectionId, tokenId, propertyKeys);
2369 }2369 }
23702370
2455 return await this.helper.rft.getPropertyPermissions(this.collectionId, propertyKeys);2455 return await this.helper.rft.getPropertyPermissions(this.collectionId, propertyKeys);
2456 }2456 }
24572457
2458 async getTokenProperties(tokenId: number, propertyKeys: string[] | null = null) {2458 async getTokenProperties(tokenId: number, propertyKeys?: string[] | null) {
2459 return await this.helper.rft.getTokenProperties(this.collectionId, tokenId, propertyKeys);2459 return await this.helper.rft.getTokenProperties(this.collectionId, tokenId, propertyKeys);
2460 }2460 }
24612461
2567 return await this.collection.getTokenNextSponsored(this.tokenId, addressObj);2567 return await this.collection.getTokenNextSponsored(this.tokenId, addressObj);
2568 }2568 }
25692569
2570 async getProperties(propertyKeys: string[] | null = null) {2570 async getProperties(propertyKeys?: string[] | null) {
2571 return await this.collection.getTokenProperties(this.tokenId, propertyKeys);2571 return await this.collection.getTokenProperties(this.tokenId, propertyKeys);
2572 }2572 }
25732573